const { app } = require('electron')
const process = require('process')
module.exports = function (Menu) {
    if (process.platform === 'darwin') {
        const template = [
            {
                label: 'Application',
                submenu: [
                    {
                        label: '退出',
                        accelerator: 'Command+Q',
                        click: function () {
                            app.quit(1)
                        }
                    }
                ]
            },
            {
                label: '编辑',
                submenu: [
                    { role: 'undo',label:'撤销' },
                    { role: 'redo',label:'重做' },
                    { type: 'separator' },
                    { role: 'cut',label:'剪切' },
                    { role: 'copy',label:'拷贝' },
                    { role: 'paste',label:'粘贴' },
                    { role: 'delete',label:'删除' },
                    { role: 'selectall',label:'全选' }
                ]
            }
        ]
        Menu.setApplicationMenu(Menu.buildFromTemplate(template))
    } else {
        Menu.setApplicationMenu(null)
    }
}
